<?php
class Chat_m extends CI_Model{
	
	private $tChat = 'chat';
	
	function send($data){
		$this->db->insert($this->tChat,$data);
	}
	function msg($id){
		$this->db->order_by('chat_id','desc');
		$this->db->where('user_id',$id);
		return	$this->db->get($this->tChat,10,0)->result_array();	
	}
}

?>